package com.ag.wzp.action;


import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.ag.bean.TbDept;
import com.ag.bean.TbDisposalAdvice;
import com.ag.bean.TbEventLevel;
import com.ag.bean.TbEventSource;
import com.ag.bean.TbEventStatus;
import com.ag.bean.TbEventType;
import com.ag.common.BaseAction;
import com.ag.wzp.service.impl.EventBaseService;
import com.ag.zhh.vo.Dept;
@Scope("prototype")
@Controller("eventBaseAction")
public class EventBaseAction extends BaseAction{
 
	private static final long serialVersionUID = 1L;
	private static Logger logger = Logger.getLogger(EventBaseAction.class);
	
	@Resource(name="eventBaseService")
	private EventBaseService eventBaseService;
	
	private List<TbEventType> eventTypes;
	private List<TbEventSource> eventSources;
	private List<TbEventLevel> eventLevels;
	private List<TbEventStatus> eventStatuses;
	//private List<TbDept> depts;
	private List<Dept> depts;
	private List<TbDisposalAdvice> das;
	private String EId;
	/**
	 * 获取所有事件等级
	 * @return json
	 */
	public String getAllEventLevel(){
		logger.info("do get AllEventLevel");
		this.eventLevels = eventBaseService.getAllEventLevel();
		return "getAllEventLevel";
	}
	
	/**
	 * 获取所有事件状态
	 * @return json
	 */
	public String getAllEventStatus(){
		logger.info("do get AllEventStatus");
		this.eventStatuses = eventBaseService.getAllEventStatus();
		return "getAllEventStatus";
	}
	
	/**
	 * 获取所有事件类型
	 * @return json
	 */
	public String getAllEventType(){
		logger.info("do get AllEventType");
		this.eventTypes = eventBaseService.getAllEventType();
		return "getAllEventType";
	}
	
	/**
	 * 获取所有事件来源
	 * @return json
	 */
	public String getAllEventSource(){
		logger.info("do get AllEventSource");
		this.eventSources = eventBaseService.getAllEventSource();
		return "getAllEventSource";
	}
	/**
	 * 获取所有部门
	 * @return json
	 * @throws Exception 
	 */
	public String getAllDept() throws Exception{
		logger.info("do get AllDept");
		this.depts = eventBaseService.getAllDept();
		return "getAllDept";
	}

	/**
	 * 获取某一事件的所有处置建议
	 * @return json
	 */
	public String findAllDAByEId(){
		logger.info("do get DAByEId"+EId);
		das = this.eventBaseService.findAllDAByEId(EId);
		return "findAllDAByEId";
	}
	
	public List<TbEventType> getEventTypes() {
		return eventTypes;
	}

	public void setEventTypes(List<TbEventType> eventTypes) {
		this.eventTypes = eventTypes;
	}

	public List<TbEventSource> getEventSources() {
		return eventSources;
	}

	public void setEventSources(List<TbEventSource> eventSources) {
		this.eventSources = eventSources;
	}

	public List<TbEventLevel> getEventLevels() {
		return eventLevels;
	}

	public void setEventLevels(List<TbEventLevel> eventLevels) {
		this.eventLevels = eventLevels;
	}

	public List<TbEventStatus> getEventStatuses() {
		return eventStatuses;
	}

	public void setEventStatuses(List<TbEventStatus> eventStatuses) {
		this.eventStatuses = eventStatuses;
	}


	public List<Dept> getDepts() {
		return depts;
	}

	public void setDepts(List<Dept> depts) {
		this.depts = depts;
	}

	public List<TbDisposalAdvice> getDas() {
		return das;
	}

	public void setDas(List<TbDisposalAdvice> das) {
		this.das = das;
	}

	public String getEId() {
		return EId;
	}

	public void setEId(String eId) {
		EId = eId;
	}
	
}
